package com.bean;

import com.utils.DateUtils;

import java.util.Date;

public class HwStu {
    private Integer id;

    private Integer hwId;

    private Integer studentId;

    private String studentName;

    private String teacherName;

    private String status;

    private String submitTime;

    private String comment;

    private String commentTime;

    private String className;

    private String hwStuAttachUrl;

    public HwStu() {
    }

    public HwStu(Integer hwId, Integer studentId, String status, Date submitTime) {
        this.hwId = hwId;
        this.studentId = studentId;
        this.status = status;
        this.submitTime = DateUtils.format(submitTime);
    }

    @Override
    public String toString() {
        return "HwStu{" +
                "id=" + id +
                ", hwId=" + hwId +
                ", studentId=" + studentId +
                ", studentName='" + studentName + '\'' +
                ", teacherName='" + teacherName + '\'' +
                ", status='" + status + '\'' +
                ", submitTime='" + submitTime + '\'' +
                ", comment='" + comment + '\'' +
                ", commentTime='" + commentTime + '\'' +
                ", className='" + className + '\'' +
                ", hwStuAttachUrl='" + hwStuAttachUrl + '\'' +
                '}';
    }

    public String getHwStuAttachUrl() {
        return hwStuAttachUrl;
    }

    public void setHwStuAttachUrl(String hwStuAttachUrl) {
        if (hwStuAttachUrl!=null) {
            this.hwStuAttachUrl = "*";
        }
    }

    public String getClassName() {
        return className;
    }

    public void setClassName(String className) {
        this.className = className;
    }

    public String getTeacherName() {
        return teacherName;
    }

    public void setTeacherName(String teacherName) {
        this.teacherName = teacherName;
    }

    public String getStudentName() {
        return studentName;
    }

    public void setStudentName(String studentName) {
        this.studentName = studentName;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getHwId() {
        return hwId;
    }

    public void setHwId(Integer hwId) {
        this.hwId = hwId;
    }

    public Integer getStudentId() {
        return studentId;
    }

    public void setStudentId(Integer studentId) {
        this.studentId = studentId;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Date getSubmitTime() {
        return DateUtils.parse(submitTime);
    }

    public void setSubmitTime(Date submitTime) {
        this.submitTime = DateUtils.format(submitTime);
    }

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    public Date getCommentTime() {
        if (commentTime == null) {
            return null;
        } else {
            return DateUtils.parse(commentTime);
        }
    }

    public void setCommentTime(Date commentTime) {
        if (commentTime == null) {
            this.commentTime = null;
        } else {
            this.commentTime = DateUtils.format(commentTime);
        }
    }
}